package v3.chapter2.synLockIn_1;

public class Run {

 	public static void main(String[] args) {
 		MyThread t=new MyThread();
 		t.start();
	}

}

class MyThread extends Thread{
	@Override
	public void run() {
		Service service=new Service();
		service.Service1();
	}
}

class Service{
	synchronized public void Service1(){
		System.out.println("Service1");
		Service2();
	}
	
	synchronized public void Service2() {
		System.out.println("Service2");
		Service3();
	}
	synchronized public void Service3() {
		System.out.println("Service3"); 
	}
}